package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import com.itheima.pinda.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 上架任务
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_grounding")
@ApiModel(value = "Grounding", description = "上架任务")
public class GroundingEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 主记录id
     */
    @ApiModelProperty(value = "主记录id")
    @NotNull(message = "主记录id不能为空", groups = {Save.class})
    @TableField(value = "master_id")
    private Long masterId;
    /**
     * 上架任务单号
     */
    @ApiModelProperty(value = "上架任务单号")
    @NotEmpty(message = "上架任务单号不能为空", groups = {Save.class})
    @Length(max = 50, message = "上架任务单号长度不能超过50")
    @TableField(value = "code")
    private String code;
    /**
     * 入库单号
     */
    @ApiModelProperty(value = "入库单号")
    @NotEmpty(message = "入库单号不能为空", groups = {Save.class})
    @Length(max = 50, message = "入库单号长度不能超过50")
    @TableField(value = "receipt_code")
    private String receiptCode;
    /**
     * 货主id
     */
    @ApiModelProperty(value = "货主id")
    @NotNull(message = "货主id不能为空", groups = {Save.class})
    @TableField(value = "owner_id")
    private Long ownerId;
    /**
     * 仓库id
     */
    @ApiModelProperty(value = "仓库id")
    @NotNull(message = "仓库id不能为空", groups = {Save.class})
    @TableField(value = "warehouse_id")
    private Long warehouseId;
    /**
     * 库区id
     */
    @ApiModelProperty(value = "库区id")
    @TableField(value = "area_id")
    private Long areaId;
    /**
     * 负责人
     */
    @ApiModelProperty(value = "负责人")
    @Length(max = 10, message = "负责人长度不能超过10")
    @TableField(value = "person_name")
    private String personName;
    /**
     * 预计到货数
     */
    @ApiModelProperty(value = "预计到货数")
    @TableField(value = "plan_num")
    private Integer planNum;
    /**
     * 实收货数
     */
    @ApiModelProperty(value = "实收货数")
    @TableField(value = "real_num")
    private Integer realNum;
    /**
     * 上架数量
     */
    @ApiModelProperty(value = "上架数量")
    @TableField(value = "grounding_num")
    private Integer groundingNum;
    /**
     * 数量差异
     */
    @ApiModelProperty(value = "数量差异")
    @TableField(value = "difference_num")
    private Integer differenceNum;
    /**
     * 完成时间
     */
    @ApiModelProperty(value = "完成时间")
    @TableField(value = "completion_time")
    private java.time.LocalDateTime completionTime;
    /**
     * 上架情况 1待分配、2上架中、3上架完成、4已取消
     */
    @ApiModelProperty(value = "上架情况 1待分配、2上架中、3上架完成、4已取消")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
